﻿function saveDepartment()
{
    var department = new Object();
    department.Dept_ID = 0;
    department.Dept_Name = $("[id$='txtDepartmentName']").val();
    $.ajax({
        url: "/Admin/AddDepartment.aspx/SaveDepartment",
        type: "POST",
        dataType: "json",
        data: JSON.stringify({ department: department }),
        contentType: "application/json; charset=utf-8"
    }).done(function (data) {
        showSuccessMsg("Data Saved Successfully!!!!!");
        $("#divCustomerWrapper").find("input[type=text]").val("");
    });
}
function saveSubDepartment() {
    var subDepartment = new Object();
    subDepartment.SubDeptID = 0;
    subDepartment.SubDeptName = $("[id$='txtSubDeptName']").val();
    subDepartment.Dept_ID = $("[id$='DDL_Department']").val();
    $.ajax({
        url: "/Admin/AddSubDepartment.aspx/SaveSubDepartment",
        type: "POST",
        dataType: "json",
        data: JSON.stringify({ subDepartment: subDepartment }),
        contentType: "application/json; charset=utf-8"
    }).done(function (data) {
        showSuccessMsg("Data Saved Successfully!!!!!");
        $("#divCustomerWrapper").find("input[type=text]").val("");
    });
}